﻿namespace OasisCiq.Xpil
{
    using System;
    using System.Linq;

    /// <summary>
    /// List of information types used for document details
    /// </summary>
    public class DocumentElementList : XS.XSNormalizedString
    {
        private static readonly string[] PossibleValues = new[] 
        {
            "DocumentID", // Usually the number of the document, which can be alphanumeric
            "DocumentName", // Name of the document.e.g. VISA, MASTERCARD for credit cards
            "Privilege", // A privilege the holder of the document was grunted. E.g. security access level
            "Restriction", // A restriction imposed on the holder of the document. E.g. learners license
            "GroupName", // A name of a larger group that recognises this document or supports it.
            "VerificationCode", // Verirfication/security code as in credit card
            "Category", // Category of the document such as Donor Type in License, Gold Card, Silver Card, Platinum Card, etc
            "IssuePlace", // Place of issue of the document. e.g.  Sydney, Australia
            "AccessCode", // Access/Security code of the document
            "Type" // Use this if the enumeration list for type of document is not used.
        };

        public DocumentElementList(string value)
            : base(value)
        {
            if (!PossibleValues.Contains(value))
            {
                throw new ArgumentOutOfRangeException();
            }
        }
    }
}